{% extends "admin/base_site.html" %}
{% load i18n %}

{% block extrahead %}
<style>
#content {
    padding: 0.5em 16px 1em;
}

#content h1 {
   margin-bottom: 0.5em;
}

/* MODULES */

.module {
    overflow: hidden;
    float: left;
    width: 100%;
    position: relative;
    margin: 0 -5px 1em;
    border: 4px solid #EBF2EE;
    background: #fff;
    -webkit-border-radius: 9px;
    -moz-border-radius: 9px;
}

.module-content {
    overflow: hidden;
    padding: 0.75em 16px;
    border: 1px solid #C0CCC4;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
}

.module .accentheader {
    overflow: hidden;
    margin-bottom: 0;
}

.module .accentheader h2 {
    float: left;
    margin-right: 8px;
    margin-top: 0.1em;
    font-size: 0.75em;
    text-transform: uppercase;
    color: #50AD2D;
}

.module h2.module-header {
    font-size: 0.875em;
    position: relative;
    padding: 0.5em 16px;
    margin: -0.857em -16px 0.875em;
    background: #ccc;
    border-bottom: 1px solid #C0CCC4;
    background: #DBE6DF url(../images/grad_bg.gif) repeat-x;
    text-shadow: 1px 1px 0 #fff;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
}

/* MINI CHART TABLES */

.minicharttable {
    border-top: 1px solid #C0CCC4;
    margin-bottom: 0.5em;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.minicharttable td {
    position: relative;
    padding: 0 4px;
    line-height: 1.875em;
    border-bottom: 1px solid #DBE6DF;
}

.minicharttable .label {
    padding: 0;
}

.minicharttable .name {
    display: block;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    text-overflow: ellipsis;
    -o-text-overflow:ellipsis;
}

.minicharttable .name a {
    padding: 0 0 0 6px;
    position: relative;
    z-index: 999;
}

.minicharttable .count,
    .minicharttable .percent {
    text-align: right;
}

.minicharttable .count {
    width: 5em;
    font-weight: bold;
}

.minicharttable .percent {
    width: 2.5em;
}

.minicharttable .more td {
    padding-left: 6px;
}

.minicharttable .more a {
    font-weight: bold;
}

.minicharttable .index {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #E1F3FA;
}


#content .module {
  width:48.5%;
}
#content .module.lookupchart .module-content {
  min-height:14em;
}
#content .module.even {
  float:right;
}
#content .module .chartlist li {
  height:1.6em;
  overflow:hidden;
}

.module-content h2 {
  background: none;
  color: #333;
  font-size:1.225em;
  line-height:1.3em;
  margin-bottom:0.4em;
  margin-top:0.25em;
  padding:0;
}
</style>
{% endblock %}


{% block breadcrumbs %}
<div class="breadcrumbs">
  <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
  <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo; 
  <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
  {{ object|truncatewords:"18" }} &rsaquo;
  {% trans 'Dashboard' %}
</div>
{% endblock %}

{% block content %}
{% if num_opinions %}
  {% for question in questions %}
  <div class="module lookupchart {% cycle 'odd' 'even' %}" id="question-{{question.position}}">
    <div class="module-content">
      <h2>{{ question.title }}</h2>
      <table class="minicharttable">
      {% for opinion in question.opinions %}
        <tr>
          <td class="label">
            <span class="name">
            	<a>{{ opinion.title }}</a>
            	<span class="index" style="width: {% widthratio opinion.count num_opinions 100 %}%"></span>
            </span>
          </td>
          <td class="count">{{ opinion.count }}</td>
          <td class="percent">{% widthratio opinion.count num_opinions 100 %}%</td>
        </tr>
      {% endfor %}
      </table>
    </div><!--/ .module-content -->
  </div><!--/ .module#datechart -->
  {% endfor %}
  <p class='clear'>
    {% blocktrans count num_opinions as count %}There is {{ count }} opinion today.{% plural %}There are {{ count }} opinions today.{% endblocktrans %}
    {% if can_download_opinions_report %}
      <a href="csv-export/">{% trans 'Download opinions report' %}</a>
    {% endif %}
  </p>
{% else %}
  <p>{% trans 'No opinions yet!' %}</p>
{% endif %}
{% endblock %}
